/*
 * @Author: XieQiu 雪球
 * @Date: 2021-06-01 10:47:33
 * @LastEditTime: 2021-06-01 11:22:33
 * @LastEditors: XieQiu 雪球
 * @Description: 仓库表接口
 */
import axios from "@/api/axios";
// import patrolTaskManage from "@/api/digital-operation/patrol-info-manage/patrol-task-manage";
// let organizationNo = sessionStorage.getItem("organizationNo")
export default {
  getTypeList() {
    return axios.get(`/v3/warehouse/warehouse/queryType`);
  },
  /**
   * @description: 获取仓库列表 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @param {Object} entity {componyId: 1} *
   * @param {String} order 排序方式 ASC DESC 默认ASC
   * @param {String} sort 自定义排序方式 'createTime'
   * @return {Array}
   */
  getWareHousingList(param) {
    param.entity.organizationNo = sessionStorage.organizationNo;
    return axios.post("/v3/warehouse/warehouse/queryPageByCondition", param);
  },

  /**
   * @description: 新增仓库信息
   * @param {Object} formData *
   * @return {Object}
   */
  addWareHouseInfo(formData) {
    formData.organizationNo = sessionStorage.organizationNo;
    return axios.post("/v3/warehouse/warehouse/add", formData);
  },
  /**
   * @description: 编辑仓库信息
   * @param {Object} formData *
   * @return {Object}
   */
  editWareHouseInfo(formData) {
    return axios.post("/v3/warehouse/warehouse/edit", formData);
  },

  // /**
  //  * @description: 批量删除数据
  //  * @param {Array} list *
  //  * @return {Object}
  //  */
  delWareHouseInfo(list) {
    return axios.post("/v3/warehouse/warehouse/delListByNo", {
      noList: list,
      organizationNo: sessionStorage.organizationNo
    });
  },

  // /**
  //  * @description: 条件查询所有仓库
  //  * @param null *
  //  * @return {Object}
  //  */
  getWareHouseListByCondition(params) {
    return axios.post("/v3/warehouse/warehouse/queryByCondition", {
      ...params,
      organizationNo: sessionStorage.organizationNo
    });
  }
};
